home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / appsrcs.zip / APPBAR.ZIP / APPDRAW.C < prev    next >
C/C++ Source or Header  |  1993-05-02  |  2KB  |  67 lines

  1. /* AppDraw.c */
  2.  
  3. /*
  4.    takes care of the drawing of the buttons
  5. */
  6.  
  7. #define STRICT
  8. #include <windows.h>
  9. #include <windowsx.h>
  10. #include "appbar.h"
  11.  
  12. /*-------------------------------------------------------------------------*/
  13. void DrawItem(LPDRAWITEMSTRUCT lpIconDIS, HICON *hIcon)
  14.     {
  15.     iCurrent = (int) (lpIconDIS->CtlID - ID_BUTTON1);
  16.     hWndCurrentButton = lpIconDIS->hwndItem;
  17.     if(!AppSystem.BigButtons)
  18.     {
  19.     if(iCurrent == SYSTEM_BUTTON)
  20.         {
  21.         DrawIcon(lpIconDIS->hDC, 0, 0, hSystem);
  22.         if(bQuickLoad)
  23.         DrawIcon(lpIconDIS->hDC, 0, 0, hQuickLoad);
  24.         }
  25.     if(iCurrent >= FirstAppButton)
  26.         {
  27.         if(hIcon[iCurrent-FirstAppButton] != NULL)
  28.         {
  29.         if(AppButton[iCurrent-FirstAppButton].ButtonLook)
  30.             DrawIcon(lpIconDIS->hDC, 0, 0, hBlank);
  31.         DrawIcon(lpIconDIS->hDC, 0, 0, hIcon[iCurrent-FirstAppButton]);
  32.         }
  33.         else
  34.         DrawIcon(lpIconDIS->hDC, 0, 0, hBlank);
  35.         if(AppButton[iCurrent-FirstAppButton].ProgStatus == ALIVE)
  36.         DrawIcon(lpIconDIS->hDC, 0, 0, hPressed);
  37.         }
  38.     if(bKeyboardOn == TRUE)
  39.         if(iCurrent == iKey)
  40.         DrawIcon(lpIconDIS->hDC, 0, 0, hKeybOn);
  41.     }
  42.     if(AppSystem.BigButtons)
  43.     {
  44.     DrawBitmap(lpIconDIS->hDC, 0, 0, hbBlank);
  45.     if(bKeyboardOn == TRUE)
  46.         if(iCurrent == iKey)
  47.         DrawBitmap(lpIconDIS->hDC, 0, 0, hbKeyb);
  48.     if(iCurrent == SYSTEM_BUTTON)
  49.         {
  50.         DrawIcon(lpIconDIS->hDC, 3, 3, hSystem2);
  51.         if(bQuickLoad)
  52.         DrawIcon(lpIconDIS->hDC, 3, 3, hQuickLoad);
  53.         }
  54.     if(iCurrent >= FirstAppButton)
  55.         {
  56.         if(hIcon[iCurrent-FirstAppButton] != NULL)
  57.         {
  58.         if(AppButton[iCurrent-FirstAppButton].ProgStatus == ALIVE)
  59.             DrawBitmap(lpIconDIS->hDC, 0, 0, hbPressed);
  60.         DrawIcon(lpIconDIS->hDC, 3, 3, hIcon[iCurrent-FirstAppButton]);
  61.         if(AppButton[iCurrent-FirstAppButton].ProgStatus == ALIVE)
  62.             DrawIcon(lpIconDIS->hDC, 3, 3, hPressed2);
  63.         }
  64.         }
  65.     }
  66.     }
  67.